<?php
    class PageController extends Main_Controller_Action
    {
        private $_arrParam;
        private $_model;
        
        public function init()
        {
            $this->loadTemplates();
            $this->_arrParam = $this->_request->getParams();
            $this->_model = new Default_Model_Page();
            if(isset($this->_arrParam['lang'])) {
                $this->view->lang = $this->_arrParam['lang'];
            }
            else {
                $this->view->lang = 'vi';
            }
        }
        
        public function indexAction()
        {
            $id = (int) $this->_arrParam['page'];
            $this->view->data = $this->_model->getPageById($id, $this->view->lang);
            $this->view->headTitle('Julytour - '.$this->view->data['title']);
        }
    }
